
//
//  HomeCollectionViewTopView.m
//  YSSmartHome
//
//  Created by Yahaong on 16/8/11.
//  Copyright © 2016年 yahaong. All rights reserved.
//

#import "HomeCollectionViewTopView.h"
#import "YHMarcros.h"

@interface HomeCollectionViewTopView ()
@property(nonatomic, strong)UIImageView *m_imgRoom;
@end
@implementation HomeCollectionViewTopView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initSubviews];
    }
    return self;
}
- (void)initSubviews
{
    self.backgroundColor = kBgColor;
    [self addSubview:self.m_imgRoom];
    [self.m_imgRoom mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self).offset(UIEdgeInsetsMake(0, 0, 10, 0));
    }];
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tap)];
    [self addGestureRecognizer:tapGesture];

}


- (void)tap {
   debugLogInfo(@"tapppppppp....");
}

- (UIImageView *)m_imgRoom
{
    if (!_m_imgRoom) {
        _m_imgRoom.userInteractionEnabled = true;
        _m_imgRoom = [[UIImageView alloc]init];
    }
    return _m_imgRoom;
}
- (void)setImageStr:(NSString *)imageStr
{
    _imageStr = [imageStr copy];
    self.m_imgRoom.image = [UIImage imageNamed:_imageStr];
 
}
@end
